export default function formatMinutes(totalMinutes) {
  totalMinutes = totalMinutes / 60
  let hours = Math.floor(totalMinutes / 60);
  let minutes = Math.floor((totalMinutes % 60) / 1);
  let seconds = (totalMinutes % 1) * 60;

  hours = hours < 10 ? '0' + hours : hours;
  minutes = minutes < 10 ? '0' + minutes : minutes;
  seconds = seconds.toFixed(0).padStart(2, '0');
  if (hours === '00') { return `${minutes}:${seconds}` }
  return `${hours}:${minutes}:${seconds}`;
}